<?php
// The file
$filename = 'fang.jpg';
$percent = 0.5;

// Content type
header('Content-type: image/jpeg');

// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = $width * $percent ;
$new_height = $height * $percent;

// Resample
$image_p = imagecreatetruecolor(220,230);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 660, 750, $new_width, $new_height, $width, $height);
//imagecopyresized($image_p, $image, 0, 0, 600, 700, $new_width, $new_height, $width, $height);
// Output
imagejpeg($image_p, null, 100);
?> 